package book.service.impl;

import book.dao.UserDao;
import book.entity.User;
import book.entity.duzhe;
import book.service.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
class UserServicesImpl implements UserServices {
    @Autowired
    private UserDao userDao;
    @Override
    public User getUser(String number, String password) {
        return userDao.getUser(number,password);
    }

    @Override
    public User login(User user) {
        return userDao.getUser(user.getUsername(),user.getPassword());
    }



    @Override
    public List<User> getAll(int offset, int limit, User condition) {
        return userDao.getAll(offset,limit,condition);
    }

    @Override
    public int getCount() {
        return 0;
    }

    @Override
    public void insert(User dz) {
        userDao.insertEntity(dz);
    }

    @Override
    public void update(User dz) {
        userDao.updateEntity(dz);
    }

    @Override
    public void delete(int id) {
        userDao.deleteEntity(id);
    }

    @Override
    public User getById(int id) {
        return userDao.getById(id);
    }

    @Override
    public void todel(List<Integer> jihe) {

    }

    @Override
    public void delrole(int id) {
        userDao.delrole(id);
    }


}
